package com.csxh.eshop.bean;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

@Entity(name="tb_order_detail")
public class OrderDetail implements Serializable {

	
	/**
	 * 
	 */
	private static final long serialVersionUID = 3149298204055764094L;
	private Integer id;
	private String name;
	
	private Order order;
	
	@ManyToOne(cascade={CascadeType.MERGE,CascadeType.REFRESH})	
	@JoinColumn(name="orderId")
	public Order getOrder() {
		return order;
	}
	
	public void setOrder(Order order) {
		this.order = order;
	}
	

	@Id @GeneratedValue(strategy=GenerationType.IDENTITY)
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	
	@Column(length=50,nullable=false)
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	
}
